import React, {Component} from 'react';
import {render, getModel} from 'react-division';
import {Select} from 'antd';

const {Option} = Select;


export default (modelName) => {

    return render({
        models: [modelName]
    })((props) => {
        const {index, colKey, onChange} = props;
        const modelData = props[modelName];
        let value = modelData.data[index][colKey];

        return (
            <Select
                value={value}
                onChange={onChange}
                key={colKey + index}
                style={{width: '100%'}}
            >
                {props.children}
            </Select>
        )
    });
}